package com.irdstudio.efp.report.service.impl;

import com.irdstudio.basic.framework.core.base.FrameworkService;
import com.irdstudio.efp.report.service.dao.AccLoanStatisticTempDao;
import com.irdstudio.efp.report.service.domain.AccLoanStatisticTemp;
import com.irdstudio.efp.report.service.facade.AccLoanStatisticTempService;
import com.irdstudio.efp.report.service.vo.AccLoanStatisticTempVo;
import org.apache.ibatis.annotations.Param;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 需求编号:2020D0554
 * 问题编号:
 * 开发人员: wengqw
 * 创建日期:2020/6/15
 * 功能描述:
 * 修改日期:2020/6/15
 * 修改描述:
 */
@Service("accLoanStatisticTempService")
public class AccLoanStatisticTempServiceImpl implements AccLoanStatisticTempService, FrameworkService {

    private static Logger logger = LoggerFactory.getLogger(AccLoanStatisticTempServiceImpl.class);

    @Autowired
    private AccLoanStatisticTempDao accLoanStatisticTempDao;

    /**
     * 统计未结清借据贷款余额之和
     *
     * @return
     */
    @Override
    public AccLoanStatisticTempVo getAccLoanStatistic(String channelCode, int startBalance, int endBalance) {
        logger.debug("当前查询数据信息的参数信息为:");
        AccLoanStatisticTempVo accLoanStatisticTempVO = new AccLoanStatisticTempVo();
        try {
            AccLoanStatisticTemp accLoanStatisticTemp = accLoanStatisticTempDao.getAccLoanStatisticTemp(channelCode, startBalance, endBalance);
            accLoanStatisticTempVO = beanCopy(accLoanStatisticTemp, accLoanStatisticTempVO);
        } catch (Exception e) {
            logger.error("数据转换出现异常!", e);
        }
        return accLoanStatisticTempVO;
    }
}
